#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main() {
	string s, s1;
	int cnt = 1;
	cin >> s1;
	for (auto ii : s1) {
		if (ii == '+')
			cnt++;
		else
			s += ii;
	}

	sort(s.begin(), s.end(), greater<char>());
	cout << s << endl;

	vector<int> ans(1e5);
	int len = s.size() / cnt, num = 0;
	for (int i = 0; i < len; i++) {
		for (int j = 0; j < cnt; j++) {
			ans[num] += s[i * cnt + j] - '0';
//			cout<<s[i*cnt+j]<<endl;
		}
		ans[num + 1] += ans[num] / 10;
		ans[num] %= 10;
		num++;
//		cout<<ans[num-1]<<endl;
	}
//	for(int i = 0;i < 10;i++)
//		cout<<ans[i]<<" ";
//	cout<<endl;
	// (cnt-1) * len + (len-1)
	int idx;
	for (idx = 1e5 - 1; ans[idx] == 0 && idx >= 0; idx--);
	if (idx < 0) {
		cout << "0";
		return 0;
	}
	for (int i = idx; i >= 0; i--)
		cout << ans[i] << " ";
	return 0;
}
